<?php
$profileURL = Common::getBaseUrl().'user/profile/';
$deleteRequestURL = Common::getBaseUrl().'user/deleterequest/';
$addRequestURL = Common::getBaseUrl().'user/addrequest/';
$addFriendURL = Common::getBaseUrl().'user/addfriend/';
?>
<section>
	<h2>List of Friend Requests</h2>
	<?php echo Common::renderFlashMessage() ?>
	<p><?php if($this->notifyMessage) { echo $this->notifyMessage; } ?></p>
	<p><?php if($this->errorMessage) { echo $this->errorMessage; } ?></p>
	<?php 
		if ($this->requests):
		foreach($this->requests as $user): 
	?>
		<article class="users">
			<p>
			<div class="username"><a href="<?php echo $profileURL.$user['username']; ?>"><?php echo $user['username']; ?></a></div>
			<div class="userAdd"><a href="<?php echo $addFriendURL.$user['username']; ?>">Accept</a> | <A href="<?php echo $deleteRequestURL.$user['username']; ?>">Reject</a></div>
			</p>
		</article>
	<?php	
		endforeach;
		endif;
	?>
</section>